#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QFontDialog>
#include <QInputDialog>
#include <QDebug>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}


void MainWindow::on_pushButton_clicked()
{
    //字体对话框给对按钮设置字体
    bool ok = true;
    QFont Font = QFontDialog::getFont(&ok);
    ui->pushButton->setFont(Font);
}

void MainWindow::on_pushButton_2_clicked()
{
    double b = QInputDialog::getDouble(this,"浮点数","请输入浮点数：");
    qDebug()<<b;
}

void MainWindow::on_pushButton_3_clicked()
{
    int b = QInputDialog::getInt(this,"整数","请输入整数：");
    qDebug()<<b;
}

void MainWindow::on_pushButton_4_clicked()
{
    QStringList item;
    item.push_back("111");
    item.push_back("222");
    item.push_back("333");
    item.push_back("444");
    QString s = QInputDialog::getItem(this,"条目","请选择",item);

}
